﻿<?php
class ModelMeUser extends Model {

	public function __construct(){

	}
	//----------------------------------------------------------//
	// Insert new user into user table of forum database
	//----------------------------------------------------------//
	public function addUserForum($data) {
		$db_forum = new DB(DB_DRIVER_FR, DB_HOSTNAME_FR, DB_USERNAME_FR, DB_PASSWORD_FR, 'fpt99xuvn_forum');
		$pass = md5(md5($db_forum->escape($data['password'])).'V.}');
		$sql = "INSERT INTO " . DB_PREFIX . " user " .
				" SET usergroupid = '" . 2 .
				"', username = '" . $db_forum->escape($data['username']) .
				"', password = '" . $pass .
				"', email = '" . $db_forum->escape($data['email']) .
				"', yahoo = '" . $db_forum->escape($data['ym']) .
				"', skype = '" . $db_forum->escape($data['skype']) .
				"', salt = 'V.}" .
				"', joindate = NOW()";
      	$db_forum->query($sql);
	}
}
?>